﻿using Avalonia.Controls;
using Avalonia.Interactivity;
using SukiUI.Dialogs;
using UI.Models;
using UI.ViewModels;

namespace UI.Views.pages;

public partial class AddPlcViewPage : UserControl
{
    private ISukiDialog? _dialog;

    public AddPlcViewPage()
    {
        InitializeComponent();
    }
    
    public AddPlcViewPage(ISukiDialog? dialog,PlcViewModel viewModel)
    {
        _dialog = dialog;
        DataContext = viewModel;
        InitializeComponent();
    }
    
    private void CloseOnClick(object? sender, RoutedEventArgs e)
    {
        if (_dialog != null) _dialog.Dismiss();
    }
}